{layout  name="public:layout" /}

<div class="content">

    <div class="header">

        <h1 class="page-title">修改账单</h1>
    </div>

    <ul class="breadcrumb">
        <li><a href="#">账单管理</a> <span class="divider">/</span></li>

        <li><a href="{:url('/allbill')}">全部账单</a><span class="divider">/</span></li>
        <li class="active">修改账单</li>
    </ul>

    <div class="container-fluid">
        <div class="row-fluid">

            <div class="btn-toolbar">
                &nbsp;
                <!--                <a href="#myModal" data-toggle="modal1" class="btn">Delete</a>-->
                <div class="btn-group">
                </div>
            </div>
            <div class="well" style="margin-top: -15px;">
                <!--                <ul class="nav nav-tabs">
                                    <li class="active"><a href="#home" data-toggle="tab">个人信息</a></li>
                                    <li><a href="#profile" data-toggle="tab">修改密码</a></li>
                                </ul>-->
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <form id="form" name="form" method="post" enctype="multipart/form-data" onsubmit="return false">
                            <input type="hidden" name='id' value="{$list.id}">
                            <input type="hidden" name="pages" value="{$page}">
                            <label>收款帐户信息：</label>
                            <input  name="account_info" type="text" value="{$list.account_info}" class="input-xlarge" style="width: 200px;">
                            <label>收款账户名称：</label>
                            <input  name="account_name" type="text" value="{$list.account_name}" class="input-xlarge" style="width: 200px;">
                            <label>时间：</label>
                            <input  name="time" type="text" value="{$list.time|date='Y-m-d H:i:s',###}" class="input-xlarge" style="width: 200px;" id="test1" autocomplete="off">

                            <label>收入方式：</label>
                            <select name="income_pattern" id="DropDownTimezone" class="input-xlarge" style="width: 200px;">
                                {volist name="mlist" id="vo"}
                                <option value="{$vo.name}" {if condition="$vo['name']==$list['income_pattern']"}selected="selected"{/if}>{$vo.name}</option>
                                {/volist}

                            </select>
                            <label>收入金额：</label>
                            <input  name="money" type="text" value="{$list.money}" class="input-xlarge" style="width: 200px;">
                            <label>付款人：</label>
                            <input  name="drawee" type="text" value="{$list.drawee}" class="input-xlarge" style="width: 200px;">      
                            <label>备注信息：</label>
                            <textarea  name="remarks" rows="8" class="input-xlarge" style="width: 400px;">{$list.remarks}</textarea>

                            <div>
                                <button class="btn btn-primary save1"><i class="icon-save"></i> 编辑</button>
                            </div>
                        </form>
                        <script>
                            //执行一个laydate实例
                            laydate.render({
                                elem: '#test1' //指定元素
                                , type: 'datetime'

                            });
                        </script>

                        <script>
                            $(".save1").click(function () {
                                var formData = new FormData(document.getElementById("form"));//表单id
                                var pages = $("[name=pages]").val();
                                $.ajax({
                                    type: "post",
                                    url: "{:url('admin/Num/doupdate')}",
                                    data: formData,
                                    async: false,
                                    cache: false,
                                    contentType: false,
                                    processData: false,
                                    dataType: 'json',
                                    success: function (data) {
                                        if (data.status !== 1)
                                        {
                                            layer.load(1, {
                                                shade: [0.1, ''], //0.1透明度的白色背景
                                                time: 500
                                            });
                                            setTimeout(function () {
                                                layer.msg(data.message, {time: 1000}, function () {
                                                });
                                            }, 500);

                                        } else
                                        {
                                            //
                                            layer.load(1, {
                                                shade: [0.1, ''], //0.1透明度的白色背景
                                                time: 500
                                            });
                                            setTimeout(function () {
                                                layer.msg(data.message, {time: 1000}, function () {
                                                    window.location.href = "{:url('/allbill')}?page=" + pages;
                                                });
                                            }, 500);
                                        }
                                    }
                                })
                            })
                        </script>
                    </div>

                </div>

            </div>
            <footer>
                <hr>

                <p class="pull-right">Collect from <a href="#" title="网页模板" >sxddd</a></p>


                <p>&copy; 2019 <a href="#" >Portnine</a></p>
            </footer>

        </div>
    </div>

</div>